<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Title</title>
</head>
<body>

</body>
<script>
	// `instanceof`是如何判断的?
	// * 表达式: L` instanceof` R
	// * 如果R函数的显式原型对象在L对象的原型链上, 返回true, 否则返回false
	function myInstanceOf(L, R) {
		L = L.__proto__;
		R = R.prototype;
		while (true) {
			if (L === R) return true;
			else if (L === null) return false;
			L = L.__proto__;
		}
	}
	
	
	function Box() {
	
	}
	
	const obj = new Box();
	console.log(myInstanceOf(obj, Box), obj instanceof Box);
	console.log(myInstanceOf(obj, Object), obj instanceof Object);
</script>
</html>